﻿using System;
using ggHD.Domain.Repisitories;
using LinqToDB.Mapping;

namespace ggHD.Domain.BizObj
{
    [Table(Schema = "dbo", Name = "Customers")]
    public partial class Customer : IEntity<string>
    {
        [Column, NotNull,PrimaryKey]
        public string ContractN { get; set; } // varchar(8)
        [Column, Nullable]
        public DateTime? DateCreate { get; set; } // date
        [Column, NotNull]
        public string LastName { get; set; } // varchar(250)
        [Column, NotNull]
        public string FirstName { get; set; } // varchar(250)
        [Column, NotNull]
        public string MiddleName { get; set; } // varchar(250)
        [Column, NotNull]
        public string Phone { get; set; } // varchar(20)
        [Column, NotNull]
        public string Email { get; set; } // varchar(100)
        [Column, Nullable]
        public DateTime? BirthDay { get; set; } // date

        [Column("ContractN")]
        public string Key
        {
            get;
            set;
        }
        
        [NotColumn]
        public string FullName {
            get
            {
                return string.Join(" ", LastName, FirstName, MiddleName);
            } }
    }
}